package com.gingko.duominuo.data.source.local.dao

import androidx.room.*
import com.gingko.duominuo.data.model.DownloadInfo
import com.gingko.duominuo.data.model.JobWorkVo


@Dao
interface JobWorkDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertTaskWork(vararg reviewTaskInfoVo: JobWorkVo): List<Long>

    @Query("select * from JobWork where userId == :userId and workId == :workId")
    suspend fun queryTask(userId: String, workId: String): List<JobWorkVo>?

    @Query("select * from JobWork where userId == :userId and jobId == :jobId and workId == :workId")
    suspend fun queryTaskWork(userId: String, workId: String, jobId: String): JobWorkVo?

    @Query("select * from JobWork where userId == :userId and jobId == :jobId and workId == :workId")
    suspend fun deleteTaskWork(userId: String, jobId: String, workId: String): JobWorkVo?

    @Query("DELETE FROM JobWork")
    suspend fun deleteAll()

    @Delete
    suspend fun delete(jobWorkVo: JobWorkVo)

}